package cn.hibernatedemo.entity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.sql.Time;

@Entity
public class Stuinfo {
    private int sid;
    private String stuname;
    private String sex;
    private Time birthdate;
    private Boolean isgratu;

    @Id
    @Column(name = "SID")
    public int getSid() {
        return sid;
    }

    public void setSid(int sid) {
        this.sid = sid;
    }

    @Basic
    @Column(name = "STUNAME")
    public String getStuname() {
        return stuname;
    }

    public void setStuname(String stuname) {
        this.stuname = stuname;
    }

    @Basic
    @Column(name = "SEX")
    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    @Basic
    @Column(name = "BIRTHDATE")
    public Time getBirthdate() {
        return birthdate;
    }

    public void setBirthdate(Time birthdate) {
        this.birthdate = birthdate;
    }

    @Basic
    @Column(name = "ISGRATU")
    public Boolean getIsgratu() {
        return isgratu;
    }

    public void setIsgratu(Boolean isgratu) {
        this.isgratu = isgratu;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Stuinfo stuinfo = (Stuinfo) o;

        if (sid != stuinfo.sid) return false;
        if (stuname != null ? !stuname.equals(stuinfo.stuname) : stuinfo.stuname != null) return false;
        if (sex != null ? !sex.equals(stuinfo.sex) : stuinfo.sex != null) return false;
        if (birthdate != null ? !birthdate.equals(stuinfo.birthdate) : stuinfo.birthdate != null) return false;
        if (isgratu != null ? !isgratu.equals(stuinfo.isgratu) : stuinfo.isgratu != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = sid;
        result = 31 * result + (stuname != null ? stuname.hashCode() : 0);
        result = 31 * result + (sex != null ? sex.hashCode() : 0);
        result = 31 * result + (birthdate != null ? birthdate.hashCode() : 0);
        result = 31 * result + (isgratu != null ? isgratu.hashCode() : 0);
        return result;
    }
}
